package com.auto.api.core.type.json.torna;

import cn.torna.sdk.param.DocParamResp;
import com.auto.api.core.type.json.AbstractTypeHandler;
import com.auto.api.core.type.json.JsonTypeHandler;
import com.google.common.collect.Lists;
import java.util.List;
import org.springframework.core.ResolvableType;

/**
 * @program:
 * @description: Torna 类型转换接口
 * @author: liangshf
 * @create: 2020-09-24
 */
public abstract class AbstractTornaApiResultJsonTypeHandler extends AbstractTypeHandler<List<DocParamResp>> implements JsonTypeHandler {

    @Override
    public List<DocParamResp> getResultInstance() {
        return Lists.newArrayList();
    }

    /**
     * 根据类型获取默认Json
     * @return
     */
    @Override
    public String doResultJson(ResolvableType resolvableType, List<DocParamResp> responseParams){
        return getResultJson(resolvableType, responseParams);
    }

    public abstract String getResultJson(ResolvableType resolvableType, List<DocParamResp> responseParams);
}
